﻿using Microsoft.AspNetCore.Mvc;
using System.Drawing;

namespace PageOffice6_Net_Core.Controllers.AfterDocOpened
{
    public class ApplicationForm : Controller
    {
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl poCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);
            PageOfficeNetCore.Word.WordDocumentWriter doc = new PageOfficeNetCore.Word.WordDocumentWriter();
            doc.OpenDataRegion("PO_Edit").Value = ("点此填写表格");
            doc.OpenDataRegion("PO_Edit").Font.Color = Color.Red;
            doc.OpenDataRegion("PO_Edit2").Value = ("点此填写表格");
            doc.OpenDataRegion("PO_Edit2").Font.Color = Color.Red;
            poCtrl.SetWriter(doc);
            //打开Word文档
            poCtrl.WebOpen("doc/ShenQingBiao.docx", PageOfficeNetCore.OpenModeType.docNormalEdit, "tom");
            ViewBag.poCtrl = poCtrl.GetHtml();
            return View();
        }
    }
}